package Operation;

/**
 * Creat with IntelliJ IDEA
 * Description
 * User: mamba24
 * Date: 2022-04-13
 * Time: 15:44
 * To BE A Better Person-2020-3-2
 */

import Book.Book;
import Book.BookList;

import java.util.Scanner;

/**
 * 新增图书
 */
public class AddOp implements IOoperation{

    @Override
    public void work(BookList bookList) {

        System.out.println("请输入书名>:");
        Scanner sc=new Scanner(System.in);
        String name=sc.nextLine();
        System.out.println("请输入作者>:");
        Scanner sc1=new Scanner(System.in);
        String author=sc1.nextLine();
        System.out.println("请输入价格>:");
        Scanner sc2=new Scanner(System.in);
        int price=sc2.nextInt();
        System.out.println("请输入种类>:");
        Scanner sc3=new Scanner(System.in);
        String type=sc3.nextLine();
        bookList.books[bookList.Used]=new Book(name,author,price,type);
        bookList.Used++;
        System.out.println("============新增成功=========");
    }
}
